<div class="page-4 commonPage">
	<div class="bg-3"></div>
	<?php echo $this->element('sidebar'); ?>
	<div class="box-right zhigh">
        <?php echo $this->element('banner'); ?>
			<div class="title">
                <ul class="breadcrumbs">
                    <li><a href="<?php echo $this->General->base_url() ?>"><img style="position: relative; top: 2px;" src="<?php echo $this->webroot ?>images/home-yl-2.png" /></a></li>
                    <?php
                        foreach($breadcrumbs as $breadcrumb)
                        {
                            echo '<li><a href="'.$this->General->base_url().$breadcrumb['link'].'">'.$breadcrumb['title'].'</a></li>';
                        }
                    ?>
                </ul>
			</div>
		<?php echo $this->element('header'); ?>
		<div class="box-detail hsth-detail">
			<div class="detail-top">
				<div class="big-image">
					<div class="main-image">
						<?php
                            foreach($images as $value)
                            {
                                $image = $this->webroot . $value['Image']['name'];
                                $image_thumb = $this->webroot . str_replace('upload/images/', 'upload/_thumbs/images/', $value['Image']['name']);
                        ?>
                                <a href="<?php echo $image ?>" rel="<?php echo $image ?>" class="zoomple"><img src="<?php echo $image ?>"/> </a>
                        <?php
                            break;
                            }
                        ?>
					</div>
					<ul class="sub-images">
                        <?php
                            $i = 0;
                            foreach($images as $value)
                            {
                                if($i++ == 5)
                                    break;
                                $image = $this->webroot . $value['Image']['name'];
                                $image_thumb = $this->webroot . str_replace('upload/images/', 'upload/_thumbs/images/', $value['Image']['name']);
                        ?>
						<li><a href="#"><img rel="<?php echo $image ?>" src="<?php echo $image ?>"/></a></li>
                        <?php
                            
                            }
                        ?>
					</ul>
				</div>
				<div class="detail-text">
					<div class="bg">
                        <div class="col-header">
                            <img src="<?php echo $this->webroot . $settings['logo_hsth'] ?>" alt="" title="" />
                            <!--div class="title-hsth"><img src="<?php echo $this->webroot ?>images/title-hsth.png" /></div-->
                        </div>
						<div class="col-detail">
                            <?php
                                foreach($product_compo as $compo)
                                {
                            ?>
							<div class="row">
								<span class="col1"><?php echo $compo['composition']['title'] ?></span>
								<span class="col2"><?php echo $compo['product_compo']['content'] ?></span>
							</div>
                            <?php
                                }
                            ?>
							<div class="clear"></div>
						</div>
						
						<div class="mailing">
							<ul>
								<?php
                                    foreach($menu_ct_san_pham as $menu_ct)
                                    {
                                        if($menu_ct['menu']['other'] == 'mail')
                                        {
                                            $l = $this->General->base_url() . $link_product;
                                            $href = $this->General->base_url() .'sendmail?u='. base64_encode($l);
                                            $target = "target='_blank'";
                                        }
                                        else
                                        {
                                            $href = $this->General->base_url() . $menu_ct['menu_desc']['link'];
                                            $target = '';
                                        }
                                        echo '<li><a '. $target .' href="'. $href .'" class="'.$menu_ct['menu']['other'].'">'.$menu_ct['menu_desc']['title'].'</a></li>';
                                    }
                                ?>
							</ul>
                            <a href="javascript:void(0)" favorite="favorite" type="hsth" product_id="<?php echo $product_info['product']['product_id'] ?>" class="favorite-hsth">
                                Lưu mục yêu thích
                                <?php
                                    if(isset($favorite[$product_info['product']['product_id']]))
                                        echo '<span><img width="12" src="'. $this->webroot .'images/check.png" /></span>';
                                ?>
                                
                            </a>
						</div>
						<div class="clear"></div>
					</div>
                    <div class="clear"></div>
                    <div class="moi-goi">
                        <?php $this->General->translate('send_image_hsth') ?>
                        
                    </div>
                    <div class="clear"></div>
					<div class="social-link">
						<!-- Go to www.addthis.com/dashboard to customize your tools -->
                        <div class="addthis_native_toolbox"></div>
					</div>
				</div>
				<div class="clear"></div>
			</div>
			<div class="promise">
				<h3><?php $this->General->translate('cam_ket') ?></h3>
				<ul>
					<li class="return">
						<span><?php $this->General->translate('tra_tien_khi_nhan_hang') ?></span>
					</li>
					<li class="shipall">
						<span><?php $this->General->translate('giao_hang_tren_toan_quoc') ?></span>
					</li>
					<li class="sure">
						<span><?php $this->General->translate('dam_bao_hang_hoa') ?></span>
					</li>
				</ul>
			</div>
			<div class="more-detail">
				<div class="tabdetail">
					<div class="title">
						<ul>
							<li class="active"><a href="#detail"><?php $this->General->translate('product_detail') ?></a></li>
							<li><a href="#info"><?php $this->General->translate('product_info') ?></a></li>
							<li><a href="#comment"><?php $this->General->translate('comment_clients') ?></a></li>
							<li><a href="#skill"><?php $this->General->translate('phat_trien_ky_nang') ?></a></li>
						</ul>
					</div>
				</div>
				<div class="tabcontent">
					<div class="tab active" id="detail">
						<table border="1" width="100%">
                            <?php
                                foreach($product_compo as $compo)
                                {
                            ?>
                                <tr>
                                    <td width="40%"><?php echo $compo['composition']['title'] ?></td>
                                    <td><?php echo $compo['product_compo']['content'] ?></td>
                                </tr>
                            <?php
                                }
                            ?>
                        </table>
					</div>
                    <div class="tab" id="info"><?php echo $product_info['product_desc']['description'] ?></div>
                    <div class="tab" id="comment">
                        <div class="comments">
            				<div class="fb-comments" data-href="<?php echo $this->General->base_url() . $link_product ?>" data-width="100%" data-numposts="5" data-colorscheme="light"></div>
                        </div>
                    </div>
                    <div class="tab" id="skill">
                        <?php echo $product_info['product_desc']['long_description'] ?>
                    </div>
				</div>
			</div>
			<div class="vote-detail">
				<div class="txt"><?php $this->General->translate('voite_product') ?>: <?php $this->General->translate('voite_start') ?></div>
				<div class="vote-box">
					<div class="votebox-1 vt">
						<input id="rating-1" type="number" product_id="<?php echo $product_info['product']['product_id'] ?>" class="rating-detail" data-show-caption="false" value="<?php echo $product_info['product']['rating'] ?>" />
                    </div>
                    <?php
                        if($product_info['product']['count_rating'] != '' && $product_info['product']['count_rating'] > 0)
                            echo '<span style="position: relative; top: 5px; left: -5px;" class="count_rating">('.$product_info['product']['count_rating'].' '.$this->General->get_translate('luot_danh_gia').'.)</span>';
                    ?>
				</div>
			</div>

		</div>
		<div class="clear"></div>
        <div class="product-favorites hsth-favorite">
                <div class="head-p-favorites">
                    <?php $this->General->translate('product_favorite') ?>
                    
                </div>
                <div class="content-p-favorites">
                    <div class="content-slider-bottom" id="uneven_slider">
                        <div class="content-slider-bottom">
                            <div class="uneven">
    	                        <?php
                                    foreach($products_favorite as $product)
                                    {
                                        $link = $this->General->base_url() . 'hoa-si-ti-hon/' . $product['product']['product_id'] .'-'. $product['link']['link'] .'.html';
                                ?>
                                <div class="slick-slide f_hsth">
        	                            <a class="actn" href="<?php echo $link ?>">
        	    							<img src="<?php echo $this->webroot . $product['image']['name'] ?>"/>
        	    						</a>
        								<div class="box-price">
    									    <a href="<?php echo $link ?>"><?php $this->General->translate('view_detail') ?></a>
								        </div>
    	                        </div>
                                <div class="slick-slide f_hsth">
        	                            <a class="actn" href="<?php echo $link ?>">
        	    							<img src="<?php echo $this->webroot . $product['image']['name'] ?>"/>
        	    						</a>
        								<div class="box-price">
    									    <a href="<?php echo $link ?>"><?php $this->General->translate('view_detail') ?></a>
								        </div>
    	                        </div>
                                
                                
    	                        <?php
                                    }
                                 ?>
    	                    </div>
                        </div>
                    </div>
                </div>
            </div>    
		
	</div>
	<?php echo $this->element('footer'); ?>
</div>